<el-descriptions class="margin-bottom" :column="3" border>
  <template slot="title">
    <span>订单信息 - {{row.order_no}}</span>

    <el-tag v-if="row.is_prebook == 1" type="warning">预约单：{{row.appoint_time_text}}</el-tag>
    <el-tag v-else type="success">即时单</el-tag>

    <el-tag v-if="row.status == 0">待支付</el-tag>
    <el-tag v-if="row.status == 10" type="success">待接单</el-tag>
    <el-tag v-if="row.status == 20" type="warning">已接单</el-tag>
    <el-tag v-if="row.status == 25" type="warning">到达取货点</el-tag>
    <el-tag v-if="row.status == 30" type="warning">配送中</el-tag>
    <el-tag v-if="row.status == 40" type="warning">已完成</el-tag>
    <el-tag v-if="row.status == 99" type="info">
        订单取消
        <span v-if="row.cancel_role == 'SYSTEM'">（系统取消）</span>
        <span v-else-if="row.cancel_role == 'CUSTOMER'">（顾客取消）</span>
        <span v-else-if="row.cancel_role == 'RIDER'">（司机取消）</span>

    </el-tag>
    <el-tag v-if="row.status == 100" type="danger">订单退款</el-tag>
  </template>
  <template slot="extra">
    <div v-if="row.refund_status == 0">
      <el-button v-if="row.status == 10" type="primary" size="small" @click="riderAssign(row.id)">指派司机</el-button>
      <el-button v-if="row.status == 20" type="primary" size="small" @click="transfer(row.id)">转单</el-button>
      <el-button v-if="row.status == 20" type="primary" size="small" @click="riderArrive(row.id)">到达取货点</el-button>
      <el-button v-if="row.status == 25" type="primary" size="small" @click="riderDelivering(row.id)">开始配送</el-button>
      <el-button v-if="row.status == 30" type="success" size="small" @click="complete(row.id)">完成配送</el-button>
      <el-button v-if="row.status < 30" type="info" size="small" @click="cancel(row.id)">取消订单</el-button>
    </div>

    <div v-if="row.refund_status > 0">
      <el-button v-if="row.refund_status == 10" type="warning" size="small" @click="refundAccept(row.id)">同意退款</el-button>
      <el-button v-if="row.refund_status == 10" type="danger" size="small" @click="refundReject(row.id)">拒绝退款</el-button>
    </div>
  </template>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-user"></i>
      区域
    </template>
    {{row.zone ? row.zone.name : '未知'}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-mobile-phone"></i>
      模块
    </template>
    {{row.module ? row.module.name : '未知'}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-location-outline"></i>
      类型
    </template>
    {{row.module_type_text}}
  </el-descriptions-item>
  <el-descriptions-item v-if="row.is_near_buy == 1">
    <template slot="label">
      <i class="el-icon-tickets"></i>
      就近购买
    </template>
    <el-tag size="small">就近购买</el-tag>
  </el-descriptions-item>
  <el-descriptions-item v-if="row.pickup_code">
    <template slot="label">
      <i class="el-icon-tickets"></i>
      取货码
    </template>
    <b>{{row.pickup_code}}</b>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      距离
    </template>
    <b>{{row.distance}}米</b>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      预计用时
    </template>
    <b>{{row.duration}}分钟</b>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      重量
    </template>
    <b>{{row.weight}}公斤</b>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      订单金额
    </template>
    <b>{{row.amount}}元</b>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      优惠金额
    </template>
    <b>{{row.discounts}}元</b>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      实际金额
    </template>
    <b>{{row.actual_amount}}元</b>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-key"></i>
      收货码
    </template>
    <b>{{row.receive_code}}</b>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      用户备注
    </template>
    {{row.remark}}
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-bottom" title="支付信息" :column="3" border> <!--v-if="row.pay_time > 0"-->
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-user"></i>
      支付金额
    </template>
    {{row.pay_fee}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-mobile-phone"></i>
      支付渠道
    </template>
    <el-tag v-if="row.pay_channel == 'WECHAT'" type="success">微信支付</el-tag>
    <el-tag v-if="row.pay_channel == 'BALANCE'" type="warning">余额支付</el-tag>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-location-outline"></i>
      支付时间
    </template>
    {{row.pay_time_text}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-office-building"></i>
      支付流水号
    </template>
    {{row.pay_transaction_id}}
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-bottom" title="起点信息" :column="3" border>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-user"></i>
      用户姓名
    </template>
    {{row.start_name}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-mobile-phone"></i>
      手机号码
    </template>
    {{row.start_mobile}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-location-outline"></i>
      起点坐标
    </template>
    经纬度：{{row.start_lng}},{{row.start_lat}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-office-building"></i>
      起点地址
    </template>
    {{row.start_address}}
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-bottom" title="终点信息" :column="3" border>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-user"></i>
      用户姓名
    </template>
    {{row.end_name}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-mobile-phone"></i>
      手机号码
    </template>
    {{row.end_mobile}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-location-outline"></i>
      终点坐标
    </template>
    经纬度：{{row.end_lng}},{{row.end_lat}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-office-building"></i>
      终点地址
    </template>
    {{row.end_address}}
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-bottom" title="接单司机" :column="3" border v-if="row.rider_id">
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-user"></i>
      当前接单司机
    </template>
    {{row.rider ? row.rider.real_name + '(' + row.rider_id + ')' : '无'}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-mobile-phone"></i>
      手机号码
    </template>
    {{row.rider ? row.rider.mobile : '无'}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-location-outline"></i>
      司机坐标
    </template>
    经纬度：<span v-if="row.rider">{{row.rider.lng}},{{row.rider.lat}}</span>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-alarm-clock"></i>
      接单时间
    </template>
    {{row.receive_time_text}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-alarm-clock"></i>
      到达取货点时间
    </template>
    {{row.arrive_time_text}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-alarm-clock"></i>
      开始配送时间
    </template>
    {{row.delivery_time_text}}
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-alarm-clock"></i>
      完成时间
    </template>
    {{row.complete_time_text}}
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-timer"></i>
      限制完成时间
    </template>
    {{row.expire_complete_time_text}}
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-bottom" title="超时理赔信息" :column="3" border v-if="row.fees.claim_minutes">
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-location-outline"></i>
      超时时间
    </template>
    <el-tag v-if="row.is_complete_overtime_claim" type="danger">超时{{row.overtime_minutes}}分钟</el-tag>
    <el-tag v-else type="success">未超时</el-tag>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-alarm-clock"></i>
      预估配送时长
    </template>
    {{row.fees.claim_minutes}}分钟
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      时长规则明细
    </template>
    <p v-for="item in row.fees.claim_detail">{{item.name}}，<el-tag>总{{item.text}}</el-tag></p>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-turn-off"></i>
      超时理赔模式
    </template>
    <el-tag v-if="row.fees.claim_mode == 'fix'">固定金额</el-tag>
    <el-tag v-else type="success">按配送费百分比</el-tag>
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-money"></i>
      扣费金额
    </template>
    <p>应扣司机{{row.fees.rider_claim_fee}}元</p>
    <p>实际赔偿{{row.fees.user_claim_fee}}元</p>
    <!--<el-tag v-if="row.status != 40" type="warning">订单未完成</el-tag>-->
  </el-descriptions-item>
  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-tickets"></i>
      赔偿规则明细
    </template>
    <p v-for="item in row.fees.claim_money_config_text" :class="item.selected ? ['text-el-success'] : []">{{item.text}}</p>
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-top" title="取消信息" :column="2" border v-if="row.status == 99">
  <!--<el-descriptions-item>
    <template slot="label">
      取消发起人
    </template>
    {{row.cancel_user_id}}
  </el-descriptions-item>-->

  <el-descriptions-item>
    <template slot="label">
      发起人角色
    </template>
    <el-tag v-if="roles[row.cancel_role]" :type="roles[row.cancel_role].tag">{{roles[row.cancel_role].label}}</el-tag>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-office-building"></i>
      取消时间
    </template>
    {{row.cancel_time_text}}
  </el-descriptions-item>
</el-descriptions>

<el-descriptions class="margin-top" title="退款信息" :column="3" border v-if="row.status == 100">
  <!--<el-descriptions-item>
    <template slot="label">
      退款发起人
    </template>
    {{row.refund_user_id}}
  </el-descriptions-item>-->

  <el-descriptions-item>
    <template slot="label">
      发起人角色
    </template>
    <el-tag v-if="roles[row.refund_role]" :type="roles[row.refund_role].tag">{{roles[row.refund_role].label}}</el-tag>
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-office-building"></i>
      退款金额
    </template>
    {{row.refund_fee}}元
  </el-descriptions-item>

  <el-descriptions-item>
    <template slot="label">
      <i class="el-icon-office-building"></i>
      退款时间
    </template>
    {{row.refund_time_text}}
  </el-descriptions-item>
</el-descriptions>

